<template>
  <div class="header">
    <div class="nav">
      <div class="icon">
        <img src="@/assets/logo.png" alt="" >
      </div>
    </div>
    <div class="navList">
      <div class="home"  :class='active==index ?"active":""' v-for="(temp,index) in array" :key="index" @click=" routerLink(temp.href)">{{temp.name}}</div>
      <!-- <div class="home">案例</div>
      <div class="home">专题</div>
      <div class="home">合作</div>
      <div class="home">关于</div> -->
    </div>
    <div class="search">
      <input  type="" placeholder="输入关键词搜索相关内容" >
    </div>
  </div>
</template>

<script>
import{} from 'vuex'
export default {
  computed:{
    active(){
     return this.$store.state.header_active 
    }
  },
  data(){
    return{
      // array:["首页","案例","专题","合作","关于" ]
      array:[
        {
        name:"首页",href:"home",
        },
        {
        name:"案例",href:"allCase",
        },
        {
        name:"专题",href:"subject",
        },
        {
        name:"合作",href:"cooperation",
        },
        {
        name:"关于",href:"about",
        }
      ]
    }
  },
  methods:{
    routerLink(name){
      this.$router.push({
        name
      })
    }
  }
}
</script>

<style lang="less">
.header {
    width: 1200px;
    height: 60px;
    line-height: 60px;
    box-sizing: border-box;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    // box-shadow: 0px 1px 8px 0px rgba(189, 189, 189, 0.32);
    .nav {
       overflow: hidden;
      width: 175px;
      padding: 0 10px;
      box-sizing: border-box;
      img {
        width: 100%;
      }
    }
    .navList {
      width: 700px;
      display: flex;
      align-items: flex-start;
      // justify-content: space-between;
      color: #606060;
      font-size: 16px;
      .home{
        padding: 0px 30px;
        margin: 0 10px;
        border-top:3px solid transparent;

      }
    }
    .search input {
      border: none;
      height: 30px;
      line-height: 30px;
      border-radius: 16px;
      background: #f4f4f4;
      padding: 0 25px;
      text-align: center;
      font-size: 12px;
    }
    .active{
      // border-top:3px solid #E44F50;
      border-color: #E44F50 !important;

      box-shadow:0px 2px 16px 0px rgba(189,189,189,0.22);
    }
  }
</style>